package BiTree;

public class elementtree {
	public elementtree right;
	public elementtree left;
	public int key;
	public String value;
	
	elementtree(String Value)
	{
		this.value=Value;
		//this.key=Key;
		this.key=ConvertToInt32(Value);
	}
	
	elementtree(int Value)
	{
		String buf="";
		//this.value=Value;
		this.key=Value;
		ConvertToString(Value, buf);
		this.value=buf;
	}
	

	private int ConvertToInt32(String tmp) {
		
	    int result=0;

        for (int i =0; i < tmp.length(); i++)

        {

            char digit = (char)(tmp.charAt(i) - '0');
        if(digit=='-')
        continue;
        else
            result += (digit * Math.pow(10, (tmp.length() - i - 1)));

        }

        return result;
		
	}
	
	private  void ConvertToString(int tmp,String buf)
	{
		buf=null;
		buf+=tmp;
	}
}
